/**
 * 
 */
package com.itboye.allshengmedical.sci;

/**
 * @author 贝贝 346551990@qq.com
 * @date 2016-12-8
 */
public class HexHelper {

	public static byte[] intToBytes(int value) {
		byte[] src = new byte[4];
		src[3] = (byte) ((value >> 24) & 0xFF);
		src[2] = (byte) ((value >> 16) & 0xFF);
		src[1] = (byte) ((value >> 8) & 0xFF);
		src[0] = (byte) (value & 0xFF);
		return src;
	}

	public static int toInt(String hex) {
		return Integer.parseInt(hex, 16);
	}

	public static byte[] change(int temp) {
		byte[] src = new byte[4];
		src[0] = (byte) (temp % 256);
		src[1] = (byte) (temp / 256);
		return src;
	}

//	public static byte[] changeTwo(int temp) {
//		byte[] src = new byte[4];
//		src[0] = (byte) (temp % 256);
//		src[1] = (byte) (temp / 256);
//		return src;
//	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
